﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
<ui:composition template="main.xhtml">
	<ui:define name="title">
		<h:outputText value="#{Lang.prop[MySession.l]['ballotadmin']}" />
	</ui:define>
	<ui:define name="body">
		<a4j:form style="margin-bottom:8px;">
			<a4j:commandLink action="#{BallotItems.buildRecordsList}" reRender="dataTable">
				<h:outputText value="#{Lang.prop[MySession.l]['search']}" class="btn" />
				<f:param name="headerId" value="#{param['headerId']}" />
			</a4j:commandLink>
		</a4j:form>
		<a4j:form id="dataForm" rendered="#{MySession.hasOp['101202']==true}">
			<rich:dataTable id="dataTable" value="#{BallotItems.recordsList}" var="item" rowKeyVar="rowNum">
				<f:facet name="header">
					<rich:columnGroup>
						<rich:column styleClass="left">
							<h:outputText value="" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{Lang.prop[MySession.l]['operation']}" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{Lang.prop[MySession.l]['title']}" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{Lang.prop[MySession.l]['orderNum']}" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{Lang.prop[MySession.l]['modifiedby']}" />
						</rich:column>
						<rich:column styleClass="right">
							<h:outputText value="#{Lang.prop[MySession.l]['modifieddate']}" />
						</rich:column>
					</rich:columnGroup>
				</f:facet>
				<rich:column style="text-align:center;width:21px;">
					<h:outputText value="#{rowNum + 1}" />
				</rich:column>
				<rich:column style="text-align:center;width:36px;white-space:nowrap">
					<a4j:commandLink action="#{BallotItems.showDialog}" onclick="#{rich:component('mpForConfirm')}.show();hideObject('dataForm:dataTable:#{rowNum}:del');">
						<h:graphicImage id="del" title="#{Lang.prop[MySession.l]['delete']}" class="imgBtn" url="images/delete.png">
						</h:graphicImage>
						<f:param name="id" value="#{item.ID_}" />
						<f:param name="reload" value="false" />
						<f:param name="headerId" value="#{param['headerId']}" />
					</a4j:commandLink>
				</rich:column>
				<rich:column style="width:200px;">
					<h:outputText value="#{item.title}" />
				</rich:column>
				<rich:column style="width:60px;text-align:center;">
					<h:outputText value="#{item.orderNum}" />
				</rich:column>
				<rich:column style="width:60px;text-align:center;">
					<h:outputText value="#{item.MUSER}" />
				</rich:column>
				<rich:column style="width:90px;text-align:center;">
					<h:outputText value="#{item.MDATE}" class="datetimeBlue"/>
				</rich:column>
			</rich:dataTable>
		</a4j:form>
		<a4j:form id="editForm">
			<h:panelGrid columns="5">
				<h:outputText value="#{Lang.prop[MySession.l]['title']}:" />
				<h:inputText value="#{BallotItems.title}" id="title" style="width:200px;">
					<rich:ajaxValidator event="onblur" />
				</h:inputText>
				<h:outputText value="#{Lang.prop[MySession.l]['modifiedby']}:" />
				<h:selectOneMenu id="selectOneRadio" value="#{BallotItems.MID_}">
					<f:selectItems value="#{Application.userSelectItem}"/>
				</h:selectOneMenu>
				<a4j:commandLink action="#{BallotItems.newRecord}" reRender="msg,dataTable">
					<h:outputText class="btn" value="#{Lang.prop[MySession.l]['newrecord']}" />
					<f:param name="redirect" value="false" />
					<f:param name="reload" value="false" />
					<f:param name="headerId" value="#{param['headerId']}" />
				</a4j:commandLink>
			</h:panelGrid>
		</a4j:form>
		<a4j:form>
			<rich:modalPanel id="mpForConfirm" width="300" height="80" zindex="3002" style="clear:both;background:url(images/warning.png) no-repeat 8px 12px #fcfae9;background-image:url(images/warning.png)">
				<a4j:outputPanel style="width:250px;margin-top:-10px;height:80px;">
					<h:panelGrid columns="3">
						<h:outputText value="#{Lang.prop[MySession.l]['deletewarning']}" style="font-size:11pt;" />
						<a4j:commandLink reRender="msg" action="#{BallotItems.deleteRecordById}" onclick="#{rich:component('mpForConfirm')}.hide()">
							<h:outputText class="btn" value="#{Lang.prop[MySession.l]['ok']}" />
							<f:param name="reload" value="false" />
						</a4j:commandLink>
						<a4j:commandLink onclick="#{rich:component('mpForConfirm')}.hide()">
							<h:outputText class="btn" value="#{Lang.prop[MySession.l]['cancel']}" />
						</a4j:commandLink>
					</h:panelGrid>
				</a4j:outputPanel>
			</rich:modalPanel>
		</a4j:form>
	</ui:define>
</ui:composition>
</html>